<?php

namespace App\Models;


class Pack extends Base
{
    /**
     * 视频分类（多对多关系）
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function videos() {
        return $this->belongsToMany(Video::class, 'pack_video')->using(PackVideo::class)->withPivot('sort');
    }
    
    /**
     * 文件夹（一对一关系）
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function folder() {
        return $this->belongsTo(Folder::class);
    }
}
